package top.llcngu.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description 服务提供者
 * @author llcngu
 * @date 2021/4/2 23:29
 * @since v1.0
 * @version v1.0
 */
@RefreshScope
@RestController
public class ProviderController {

    @Value("${provider.name}")
    private String name;

    @Value("${provider.config1}")
    private String config1;

    @Value("${provider.config2}")
    private String config2;

    /**
     * @description 返回配置文件中的llcngu.name属性的值
     * @author llcngu
     * @date 2021/4/3 17:00
     * @return 拼接后的结果
     */
    @GetMapping("/provider")
    public String test() {
        return this.name + ":" + this.config1 + ":" + this.config2;
    }
}
